<?php

namespace Pyaf\GymBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class PersonaType extends AbstractType
{
     public function buildForm(FormBuilderInterface $builder, array $options){
        
        $builder->add('nombre')
                ->add('apellido')
                ->add('dni', 'text')                
                ->add('fecha_nacimiento', 'birthday', array('format' => 'dd-MM-yyyy',))
                ->add('telefono', 'text')
                ->add('celular', 'text')
                ->add('direccion')
                ->add('email', 'email')
//                ->add('imagen')
                ->add('anexo', 'textarea', array('max_length' => 1000, 'trim' => 'true'))
                ->add('habilitado', 'checkbox');
    }
    
    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'Pyaf\GymBundle\Entity\Persona',
        ));
    }

    public function getName(){
        return 'persona_form';
    }
}

?>
